blob: 8fe49578c195c1a0c0d4d63d2dda5863a3545cb2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
import { redirect } from "@sveltejs/kit";
export const load = async ({ cookies, params }) => {
const { token } = params;
const maxAge = 380 * 24 * 60 * 60;
const expires = new Date();
expires.setSeconds(expires.getSeconds() + maxAge);
const opts = { path: "/", expires };
cookies.set("token", token, opts);
redirect(307, "/login");
};
|